import { createRouter, createWebHashHistory } from 'vue-router'
import Home from './views/Home.vue'
import Layout from './views/Layout.vue'

const routes = [
    {
        path: '/',
        name: 'YourTool',
        component: Layout,
        hidden: true,
        redirect: '/home',
        children: [
            {
                path: 'home',
                name: '首页',
                component: Home
            },
            {
                path: 'timeline',
                name: '时间线',
                component: () => import('./views/TimeLine.vue')
            },
            {
                path: 'acg',
                name: '追剧表',
                component: () => import('./views/Acg.vue')
            },
            {
                path: 'ip',
                name: 'IP溯源',
                component: () => import('./views/Ip.vue')
            },
            {
                path: 'json-opration',
                name: 'JSON操作',
                component: () => import('./views/JsonOp.vue')
            },
            {
                path: 'time-convert',
                name: '时间转换',
                component: () => import('./views/TimeConvert.vue')
            },
            {
                path: 'url-codec',
                name: 'URL编解码',
                component: () => import('./views/UrlCodec.vue')
            },
            {
                path: 'qrcode',
                name: '二维码生成',
                component: () => import('./views/Qrcode.vue')
            }
        ]
    },
    {
        path: '/login',
        name: '登录',
        component: () => import('./views/common/Login.vue')
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

export default router